package liangtWorkSpace.springAll.teamplate;

import liangtWorkSpace.springAll.teamplate.client.HelloWorld;
import liangtWorkSpace.springAll.teamplate.parent.HelloIndex;
import liangtWorkSpace.springAll.teamplate.parent.HelloIndia;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liangt
 * @ClassName: TeamplateTest
 * @title: TeamplateTest
 * @projectName liangtWorkSpace.springAll.teamplate
 * @description: 测试Spring自定义继承
 * @date 2020/10/15 17:14
 */
public class TeamplateTest {

    public static void main(String[] args) {
        String xmlPath = "teamplate/Beans.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);

        HelloWorld helloWorld = (HelloWorld) applicationContext.getBean("helloWorld");
        helloWorld.getMessage1();
        helloWorld.getMessage2();

        HelloIndia helloIndia = (HelloIndia) applicationContext.getBean("helloIndia");
        helloIndia.getMessage1();
        helloIndia.getMessage2();
        helloIndia.getMessage3();

        HelloIndex helloIndex = (HelloIndex) applicationContext.getBean("helloIndex");
        helloIndex.getMessage1();
        helloIndex.getMessage2();
        helloIndex.getMessage3();
    }
}
